using MicroMsg.Protocol;
using MicroMsg.Resource.@string;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class FAQPage : BasePage
	{
		private ApplicationBar mBar;
		internal Grid LayoutRoot;
		internal WebBrowser webBrowser;
		internal ClickableLayout feedbackTipLayout;
		private bool _contentLoaded;
		public FAQPage()
		{
			this.InitializeComponent();
		}
		protected override void OnPageIn(object[] object_0)
		{
			string text = string.Format("http://weixin.qq.com/cgi-bin/helpcenter?clientversion={0}", ConstantsProtocol.CLIENT_VERSION);
			this.webBrowser.set_Source(new Uri(text));
			this.webBrowser.add_GotFocus(new RoutedEventHandler(this.feedbackTipLayout_Tap));
			base.set_ApplicationBar(this.GetApplicationBar());
		}
		protected override void OnPageOut()
		{
		}
		private void feedbackTipLayout_Tap(object sender, EventArgs e)
		{
			this.feedbackTipLayout.set_Visibility(1);
		}
		public IApplicationBar GetApplicationBar()
		{
			if (this.mBar != null)
			{
				return this.mBar;
			}
			this.mBar = new ApplicationBar();
			this.mBar.set_IsMenuEnabled(true);
			this.mBar.set_IsVisible(true);
			ApplicationBarIconButton applicationBarIconButton = new ApplicationBarIconButton(new Uri("/Resource/Img/Settings/bar_feedback.png", 2));
			applicationBarIconButton.set_Text(strings.Set_Main_Feedback);
			applicationBarIconButton.add_Click(new EventHandler(this.feedbackButton_Click));
			this.mBar.get_Buttons().Add(applicationBarIconButton);
			ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton(new Uri("/Resource/Img/Settings/bar_refresh.png", 2));
			applicationBarIconButton2.set_Text(strings.Set_Feedback_Refresh);
			applicationBarIconButton2.add_Click(new EventHandler(this.refreshButton_Click));
			this.mBar.get_Buttons().Add(applicationBarIconButton2);
			return this.mBar;
		}
		private void feedbackButton_Click(object sender, EventArgs e)
		{
			this.feedbackTipLayout_Tap(null, null);
			base.GoToPage("/Source/UI/Setting/FeedBackPage.xaml", null, false);
		}
		private void refreshButton_Click(object sender, EventArgs e)
		{
			if (this.webBrowser.get_Source() != null)
			{
				this.feedbackTipLayout_Tap(null, null);
				string absoluteUri = this.webBrowser.get_Source().get_AbsoluteUri();
				this.webBrowser.set_Source(new Uri(absoluteUri));
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/Setting/FAQPage.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.webBrowser = (WebBrowser)base.FindName("webBrowser");
			this.feedbackTipLayout = (ClickableLayout)base.FindName("feedbackTipLayout");
		}
	}
}
